import request from "@/utils/request";

// 查询护理计划列表
export function listPlan(query) {
  return request({
    url: "/service/plan/list",
    method: "get",
    params: query,
  });
}

// 根据id查询护理计划，带有该护理计划包裹的所有项目
export function getPlan(id) {
  return request({
    url: "/service/plan/" + id,
    method: "get",
  });
}

// 新增护理计划，新增的时候注意要添加的护理项目
export function addPlan(data) {
  return request({
    url: "/service/plan",
    method: "post",
    data: data,
  });
}

// 修改护理计划，修改的时候注意要修改的护理项目
export function updatePlan(data) {
  return request({
    url: "/service/plan",
    method: "put",
    data: data,
  });
}

// 删除护理计划
export function delPlan(id) {
  return request({
    url: "/service/plan/" + id,
    method: "delete",
  });
}

// 停用/启用护理计划
export function changeStatus(id, status) {
  return request({
    url: "/service/plan/changeStatus/",
    method: "put",
    params: { id: id, status: status },
  });
}

//查询所有的护理项目
export function listCareItem() {
  return request({
    url: "/service/item/availableList",
    method: "get",
  });
}

//查询护理等级对应的护理计划id
export function getPlanIds() {
  return request({
    url: "/service/plan/ids",
    method: "get",
  });
}
